package game;

import javax.swing.*;
import java.awt.*;

public class Bomb {

    private int x;
    private int y;
    private int height;
    private int width;
    private ImageIcon imageIcon = new ImageIcon("img/bomb.png");
    private int flag;//删除的次数

    public Bomb(int x,int y){
        this.x =x;
        this.y = y;
        this.height = imageIcon.getIconHeight();
        this.width =imageIcon.getIconWidth();
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public ImageIcon getImageIcon() {
        return imageIcon;
    }

    public void setImageIcon(ImageIcon imageIcon) {
        this.imageIcon = imageIcon;
    }

    public void drawImage(Graphics g) {
        g.drawImage(imageIcon.getImage(), x, y, null);

    }

    public void delete() {
        flag +=1;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }
}